package com.chenfan.mcn.model;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;

import com.chenfan.mcn.extension.log.FieldDesc;
import com.chenfan.mcn.constant.NumberFormatCst;
import com.chenfan.mcn.enums.ArchivingStatusEnum;
import com.chenfan.mcn.enums.StarRebateStatusEnum;
import com.chenfan.mcn.extension.log.FieldTypeEnum;
import com.chenfan.mcn.component.dict.*;
import com.chenfan.mcn.model.base.BaseOwnerEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 红人返点合同
 * </p>
 *
 * @author wulg
 * @since 2021-11-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("star_rebate_contract")
public class StarRebateContract extends BaseOwnerEntity {

    private static final long serialVersionUID = -2648471402872366789L;

    /**
     * 合同编号
     */
    @TableField("contract_code")
    private String contractCode;

    /**
     * 单据状态
     */
    @FieldDesc(value = "单据状态", translator = StarRebateStatusEnum.class)
    @TableField("approval_status")
    private Integer approvalStatus;

    /**
     * 返点比例
     */
    @FieldDesc(value = "返点比例", format = NumberFormatCst.PERCENT)
    @TableField("rebate_ratio")
    private BigDecimal rebateRatio;

    /**
     * 返点金额
     */
    @FieldDesc(value = "返点金额", format = NumberFormatCst.AMOUNT)
    @TableField("rebate_amount")
    private BigDecimal rebateAmount;

    /**
     * 红人ID
     */
    @FieldDesc(value = "红人昵称", translator = StarBasicDataIdTranslator.class)
    @TableField("star_id")
    private Long starId;

    /**
     * 我司签约主体
     */
    @FieldDesc(value = "我司签约主体", translator = ContractingIdTranslator.class)
    @TableField("contracting_id")
    private Long contractingId;

    /**
     * 红人开票信息id
     */
    @FieldDesc(value = "开票抬头", translator = StarBillingIdTranslator.class)
    @TableField("star_billing_id")
    private Long starBillingId;

    /**
     * 年框合同主键id
     */
    @TableField("year_contract_id")
    private Long yearContractId;

    /**
     * 年框合同编号
     */
    @FieldDesc(value = "年框合同编号")
    @TableField("year_contract_code")
    private String yearContractCode;

    /**
     * 最近回款日期
     */
    @TableField("payback_date")
    private Date paybackDate;

    /**
     * 累计回款金额
     */
    @FieldDesc(value = "累计回款金额")
    @TableField("payback_amount")
    private BigDecimal paybackAmount;

    /**
     * 归档编号
     */
    @FieldDesc(value = "归档编号")
    @TableField("archiving_code")
    private String archivingCode;

    /**
     * 归档状态
     */
    @FieldDesc(value = "归档状态", translator = ArchivingStatusEnum.class)
    @TableField("archiving_status")
    private Integer archivingStatus;

    /**
     * 上传合同
     */
    @FieldDesc(value = "上传合同", fieldType = FieldTypeEnum.FILE)
    @TableField("contract_file")
    private String contractFile;

    /**
     * 备注
     */
    @FieldDesc(value = "备注")
    @TableField("remark")
    private String remark;

    /**
     * 暂不做关联表
     */
    @TableField("archived_excute_ids")
    private String archivedExcuteIds;

}
